namespace UniversalAdminSystem.Domian.Core.ValueObjects;

public record RoleId
{
    public Guid Value { get; init; }

    private RoleId(Guid value)
    {
        if (Guid.Empty == value)
            throw new ArgumentException("RoleId不能为空");

        Value = value;
    }

    public static RoleId Create(Guid value) => new(value);

    public static explicit operator RoleId(Guid value) => Create(value);
    public static implicit operator Guid(RoleId roleId) => roleId.Value;
}